home *** CD-ROM | disk | FTP | other *** search
- @echo off
- REM ***************************************************
- REM *** CmdCount.bat - Repeat a command some number ***
- REM *** ver.1 of times. ***
- REM ***************************************************
-
- REM ****************************************
- REM *** If no commands specified, then ***
- REM *** give instructions for how to use ***
- REM ****************************************
- IF NOT "%2"=="" GOTO REPEAT_COMMAND
- ECHO CMDCOUNT.BAT - Repeat a command a number of times
- ECHO USAGE: CMDCOUNT Count Commands...
- ECHO WHERE: Count - Number of times to repeat command
- ECHO Commands... - Any DOS command to repeat
- ECHO EXAMPLE: CMDCOUNT
- GOTO BYE_BYE
-
- :REPEAT_COMMAND
- REM **********************************************
- REM *** START COUNT ENVIRONMENT VARIABLE AT 0 ***
- REM *** LOOP THROUGH COMMANDS UNTIL IT REACHES ***
- REM *** THE FIRST INPUT VARIABLE ***
- REM **********************************************
- SET COUNT=0
- :TOP_OF_LOOP
- %2 %3 %4 %5 %6 %7 %8 %9
- CEnvi COUNT = COUNT + 1
- IF NOT %COUNT%==%1 GOTO TOP_OF_LOOP
-
- :BYE_BYE
- SET COUNT=